//index.js
//获取应用实例
var app = getApp();
var _openid = app.getOpenId();
var WxParse = require('../../wxParse/wxParse.js');

Page({
  data: {
    parkingInfo: [],
  },

  //事件处理函数
  swiperchange: function (e) {
    this.setData({
      swiperCurrent: e.detail.current
    })
  },
  onLoad: function (e) {
    if (e.inviter_id) {
      wx.setStorage({
        key: 'inviter_id_' + e.id,
        data: e.inviter_id
      })
    }
    var that = this;
    wx.request({
      url: app.globalData.domain + app.globalData.subDomain +'/parking/detail?',
      method: 'post',
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      data: {
        openid: _openid,
        id: e.id
      },
      success: function (res) {
        var parkingInfo = [];
        if (res.data.obj.length == 0) {
          that.setData({
            loadingMoreHidden: false,
          });
          return;
        }
        parkingInfo.push(res.data.obj);

        that.setData({
          parkingInfo: parkingInfo,
        });
      }
    })
  },

  bookParking: function () {

  },
})
